{template 'common/header'}

<ul class="nav nav-tabs">
	<li {if $operation == 'display'} class="active" {/if}><a href="{php echo $this->createWebUrl('goods_cate',array('op' =>'display'))}">线报商品分类管理</a></li>
	<li{if empty($bigcat['id']) && $operation == 'post'} class="active" {/if}><a href="{php echo $this->createWebUrl('goods_cate',array('op' =>'post'))}">添加分类</a></li>
	<li{if empty($bigcat['id']) && $operation == 'post'} class="active" {/if}><a href="{php echo $this->createWebUrl('goods_cate',array('op' =>'post_jd'))}">同步京东分类</a></li>
	<li{if empty($bigcat['id']) && $operation == 'post'} class="active" {/if}><a href="{php echo $this->createWebUrl('goods_cate',array('op' =>'post_pdd'))}">同步拼多多分类</a></li>
	<li{if empty($bigcat['id']) && $operation == 'post'} class="active" {/if}><a href="{php echo $this->createWebUrl('goods_cate',array('op' =>'post_tb'))}">同步淘宝分类</a></li>
	{if !empty($bigcat['id']) &&  $operation == 'post'}<li  class="active"><a href="{php echo $this->createWebUrl('goods_cate',array('op' =>'post','id'=>$bigcat['id']))}">编辑分类</a></li>{/if}
</ul>

{if $operation == 'display'}
<div class="main panel panel-default">
	<div class="panel-body table-responsive">
		<form action="" method="post">
		<table class="table table-hover">
			<thead class="navbar-inner">
				<tr>
					<th style="width:8%;">排序</th>
					<th style="width:10%;">平台</th>
					<th style="width:10%;">分类名称</th>
					<th style="width:10%;">分类ID</th>
					<th style="width:10%;">状态</th>
					<th style="text-align:right;">操作</th>
				</tr>
			</thead>
			<tbody>
				{loop $list $bigcat}
				<tr>
					<td><input class="form-control" name="displayorder[{$bigcat['id']}]" value="{$bigcat['displayorder']}" type="text"></td>
					<td>
						<span>{$bigcat['pintai']}</span>
					</td>

					<td>
						<span>{$bigcat['catename']}</span>
					</td>
					<td>
						<span>{$bigcat['cateid']}</span>
					</td>

					<td>
						{if $bigcat['is_show'] == 1}
						<span>显示</span>
						{else}
						<span>隐藏</span>
						{/if}
					</td>
					<td style="text-align:right;">
					    <a href="{php echo $this->createWebUrl('goods_cate', array('op' => 'show', 'id' => $bigcat['id']))}" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" title="{if $bigcat['is_show'] == 1}隐藏{/if}">{if $bigcat['is_show'] == 1}隐藏{/if}{if $bigcat['is_show'] == 0}显示{/if}</a>
						<a href="{php echo $this->createWebUrl('goods_cate', array('op' => 'post', 'id' => $bigcat['id']))}" class="btn btn-default btn-sm" title="修改"><i class="fa fa-edit"></i></a>
						<a href="{php echo $this->createWebUrl('goods_cate', array('op' => 'delete', 'id' => $bigcat['id']))}"class="btn btn-default btn-sm" onclick="return confirm('此操作不可恢复，确认删除？');return false;" data-toggle="tooltip" data-placement="top" title="删除"><i class="fa fa-times"></i></a>
					</td>
				</tr>
				{/loop}
				<tr>
					<td colspan="5">
						<input name="token" value="{$_W['token']}" type="hidden">
						<input name="op" value="display" type="hidden">
						<input name="submit" class="btn btn-primary" value="修改排序" type="submit">
					</td>
				</tr>
			</tbody>
		</table>
		{$pager}
		</form>
	</div>
</div>
{elseif $operation == 'post'}

<div class="main">
	<form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">
		<input type="hidden" name="id" value="{$bigcat['id']}" />
		<div class="tab-content">
			<div role="tabpanel" class="tab-pane active panel panel-default" id="basic">
				<div class="panel-body">
					<div class="form-group">
						<label class="col-xs-12 col-sm-3 col-md-2 control-label">排序</label>
						<div class="col-sm-9 col-xs-12">
							<input type="text" name="data[displayorder]" class="form-control" value="{$bigcat['displayorder']}" />
						</div>
					</div>
					<div class="form-group">
						<label class="col-xs-12 col-sm-3 col-md-2 control-label">所属平台</label>
						<div class="col-sm-9 col-xs-12">
							<input type="text" name="data[pintai]" class="form-control" value="{$bigcat['pintai']}" />
						</div>
					</div>

					<div class="form-group">
						<label class="col-xs-12 col-sm-3 col-md-2 control-label">分类名称</label>
						<div class="col-sm-9 col-xs-12">
							<input type="text" name="data[catename]" class="form-control" value="{$bigcat['catename']}" />
						</div>
					</div>
					<div class="form-group">
						<label class="col-xs-12 col-sm-3 col-md-2 control-label">分类ID</label>
						<div class="col-sm-9 col-xs-12">
							<input type="text" name="data[cateid]" class="form-control" value="{$bigcat['cateid']}" />
						</div>
					</div>

					<div class="form-group">
						<label class="col-xs-12 col-sm-3 col-md-2 control-label">是否显示</label>
						<div class="col-sm-9 col-xs-12">
							<label class='radio-inline'>
								<input type='radio' name='data[is_show]' value='1' {if $bigcat['is_show']==1}checked{/if} /> 是
							</label>
							<label class='radio-inline'>
								<input type='radio' name='data[is_show]' value='0' {if $bigcat['is_show']==0}checked{/if} /> 否
							</label>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="form-group col-sm-12">
			<input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />
			<input type="hidden" name="token" value="{$_W['token']}" />
		</div>
	</form>
</div>
<script>
$(function(){

})
</script>
{/if}
{template 'common/footer'}